
#---Portmann & Stojanovic 2017: Electoral discrimination against immigrant-origin candidates---#

#load("PrefVotes")

#-------------------- ESTIMATE MODEL (HIERARCICAL BETA REGRESSION, NAME ORIGIN WITH RESPECT TO LANGUAGE REGION)

model5 <- glmmadmb(crossoff_pct ~ nonswissname_lang + incumbent + c_relposition_rc + precumulated + 
                     sex_d + age_c3 + CodeBerufK3 + num_cand + party_c3 + commune
                   (~1|list_id), data=d, family="Beta", admb.opts=admbControl(shess=FALSE,noinit=FALSE))


#-------------------- REGRESSION TABLE

htmlreg(list(model5), custom.model.names = c("Model 1"),
        caption = "Negative preference votes vs. name origin (with regard to language region)",
        label = "tab:5",
        stars = c(0.05, 0.01, 0.001),
        dcolumn = TRUE,
        booktabs = TRUE,
        use.packages = FALSE,
        single.row = TRUE,
        include.adjrs = FALSE,
        include.bic = FALSE, file = "Table7.doc")



